package com.kt.service.imp;

import com.kt.dao.ProductDAO;
import com.kt.dao.imp.ProductDAOImp;
import com.kt.domain.Product;
import com.kt.utils.UtilDB;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class ProductServiceImp implements ProductDAO {

    private ProductDAOImp productDAOImp = new ProductDAOImp();



    public List<Product> findAllProducts(Integer firstPid) {
        return productDAOImp.findAllProducts(firstPid);
    }

    public List<Product> findProductByUid(int uid) {
        return productDAOImp.findProductByUid(uid);
    }

    public List<Product> findProductByBrand(String brand) {
        return productDAOImp.findProductByBrand(brand);
    }

    public List<Product> findProductByCid(int cid) {
        return productDAOImp.findProductByCid(cid);
    }

    @Override
    public List<Product> findProductByKewWord(String kw) {
        return productDAOImp.findProductByKewWord(kw);
    }

    public Product findByName(String name) {
        return productDAOImp.findByName(name);
    }

    public Product findById(String id) {
        return productDAOImp.findById(id);
    }

    public int delete(String name) {
        return productDAOImp.delete(name);
    }

    public int addProduct(Product product) {
        return productDAOImp.addProduct(product);
    }

    public int changeProductInfo(Product product) {
       return productDAOImp.changeProductInfo(product);
    }
}
